package com.ss.android.article.base.feature.detail.model;

import org.json.JSONObject;

public final class PhoneAdsData extends g {
    public String image;
    public int imageWidth;
    public int imageHeight;
    public int displaySubType;
    public String h;
    public String sourceName;
    public String j;
    public int videoWidth;
    public int videoHeight;
    public int videoDuration;
    public String videoId;
    public String videoCoverUrl;
    public String phoneNumber;
    public String buttonText;
    private JSONObject videoInfoJO;

    public PhoneAdsData() {
        super(5);
    }

    public final void initWithJO(JSONObject jo) {
        if(jo != null) {
            super.initWithJO(jo);
            this.image = jo.optString("image");
            this.imageWidth = jo.optInt("image_width");
            this.imageHeight = jo.optInt("image_height");
            this.displaySubType = jo.optInt("display_subtype", 3);
            jo.optString("description");
            this.h = jo.optString("label", "");
            this.sourceName = jo.optString("source_name", "");
            this.videoInfoJO = jo.optJSONObject("video_info");
            this.j = jo.optString("title");
            this.phoneNumber = jo.optString("phone_number");
            this.buttonText = jo.optString("button_text");
            if(this.videoInfoJO == null) {
                return;
            }

            try {
                this.videoWidth = this.videoInfoJO.optInt("width");
                this.videoHeight = this.videoInfoJO.optInt("height");
                this.videoDuration = this.videoInfoJO.optInt("video_duration");
                this.videoId = this.videoInfoJO.optString("video_id");
                this.videoCoverUrl = this.videoInfoJO.optString("cover_url");
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
        }
    }
}

